import request from '@utils/request'

// 申请列表查询
export function getList (data) {
  return request({
    url: '/dormitoryBed/getBedList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 修改院系信息
export function updateCollege (data) {
  return request({
    url: '/dormitoryBed/updateBedCollege',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 修改床位状态
export function updateBedDetail (data) {
  return request({
    url: '/dormitoryBed/updateBedDetail',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 查询辅导员带班信息
export function getInformation (data) {
  return request({
    url: '/gradeInformation/getInformation',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 导出床位信息
export function exportBedExcel (data) {
  return request({
    url: '/dormitoryBed/exportBedExcel',
    method: 'post',
    data: data,
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}


// 根据寝室查询床位信息
export function getBedListByDorm (query) {
  return request({
    url: '/dormitoryBed/getBedListByDorm',
    method: 'post',
    params: query,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}